package com.ronglian.register_mini_program.model.web;

import com.github.pagehelper.PageInfo;

import java.util.List;

import java.util.List;

public class PageResult<T> {
    private List<T> dataList;
    private long total;
    private long pages;
    private long pageNum;
    private long pageSize;

    public PageResult() {
    }

    public static PageResult getPageResult(PageInfo pageInfo) {
        PageResult pageResult = new PageResult<>();
        pageResult.setDataList(pageInfo.getList());
        pageResult.setTotal(pageInfo.getTotal());
        pageResult.setPageSize(pageInfo.getSize());
        pageResult.setPages(pageInfo.getPages());
        pageResult.setPageNum(pageInfo.getPageNum());
        return pageResult;
    }

    public List<T> getDataList() {
        return this.dataList;
    }

    public void setDataList(List<T> dataList) {
        this.dataList = dataList;
    }

    public long getTotal() {
        return this.total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public long getPages() {
        return this.pages;
    }

    public void setPages(long pages) {
        this.pages = pages;
    }

    public long getPageNum() {
        return this.pageNum;
    }

    public void setPageNum(long pageNum) {
        this.pageNum = pageNum;
    }

    public long getPageSize() {
        return this.pageSize;
    }

    public void setPageSize(long pageSize) {
        this.pageSize = pageSize;
    }
}
